package com.itheima.controller;

import com.itheima.mapper.StudentMapper;
import com.itheima.pojo.JobOptions;
import com.itheima.pojo.Result;
import com.itheima.pojo.StudentCount;
import com.itheima.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class ReportController {
    @Autowired
    private ReportService reportService;
    @Autowired
    private StudentMapper studentMapper;

    @GetMapping("/report/empJobData")
    public Result empJobData(){
        JobOptions jobOptions = reportService.getEmpJobData();
        return Result.success(jobOptions);
    }

    @GetMapping("/report/empGenderData")
    public Result getEmpGenderData(){
        List<Map<String, Object>> empGenderData = reportService.getEmpGenderData();
        return Result.success(empGenderData);
    }

    @GetMapping("/report/studentDegreeData")
    public Result getStudentDegreeData(){
        List<Map<String, Object>> studentDegreeData = reportService.getStudentDegreeData();
        return Result.success(studentDegreeData);
    }

    @GetMapping("/report/studentCountData")
    public Result getStudentCountData(){
        StudentCount studentCount = reportService.getStudentCountData();
        return Result.success(studentCount);
    }


}
